package com.li.jiang.utils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class MyStringUtil {
    //将 list变为逗号分隔的字符串
    public static String listToString(List<String> list){
        StringBuilder sb = new StringBuilder();

        for (String s :list){
            sb.append(s);
            sb.append(",");
        }
        return sb.toString();
    }
    public static List<String> stringToList(String s){
        String[] list = s.split(",");
        return Arrays.asList(list);
    }
}
